﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MES_SystemUI.Domain
{
    /// <summary>
    /// 物料详细表
    /// </summary>
    public class MaterialDetail
    {
        /// <summary>
        /// 物料详细表主键，自增
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int MaterialDetailId { get; set; }
        /// <summary>
        /// 物料，外键
        /// </summary>
        [Required]
        public int MaterialId { get; set; }
        /// <summary>
        /// 物料规格，外键
        /// </summary>
        [Required]
        public int MaterialDetailSpecId { get; set; }
        /// <summary>
        /// 物料材质
        /// </summary>
        [Required]
        [Column(TypeName = "varchar")]
        [StringLength(20)]
        public string MaterialDetailTexture { get; set; }
        /// <summary>
        /// 物料单位，外键
        /// </summary>
        [Required]
        public int MaterialDetailUnitId { get; set; }
        /// <summary>
        /// 物料数量
        /// </summary>
        [Required]
        public int MaterialDetailCount { get; set; }
        /// <summary>
        /// 物料截面形状
        /// </summary>
        [Column(TypeName ="varchar")]
        [StringLength(20)]
        public string MaterialDetailSectionShape { get; set; }
        /// <summary>
        /// 物料类型，外键
        /// </summary>
        public int MaterialDetailCategorieId { get; set; }
        /// <summary>
        /// 物料重量
        /// </summary>
        public int? MaterialDetailWeight { get; set; }
        /// <summary>
        /// 物料长度
        /// </summary>
        public int? MaterialDetailLength { get; set; }
        /// <summary>
        /// 物料厚度
        /// </summary>
        public int? MaterialDetailThickness { get; set; }
        /// <summary>
        /// 存放仓库，外键
        /// </summary>
        [Required]
        public int StoreId { get; set; }
        /// <summary>
        /// 实物图片
        /// </summary>
        public byte?[] RealPicture { get; set; }
        /// <summary>
        /// 数据状态  0 正常 1 删除
        /// </summary>
        [Required]
        public int Status { get; set; } = 0;
        /// <summary>
        /// 创建人，外键
        /// </summary>
        [Required]
        public int CteateUserId { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [Required]
        public DateTime CreateTime { get; set; } = DateTime.Now;
        /// <summary>
        /// 最后修改人，外键
        /// </summary>
        public int? LastUpdateUserId { get; set; }
        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime? LastUpdateTime { get; set; }
    }
}
